<?php
  include_once(dirname(__file__) . "/config.php");
  $id = (int)$_GET['id'];
  if($id==''&$id!=0)
  {
	  $per = explode(',',$_SESSION["permission"]);	
	  for($i=0;$i<count($per);$i++)
	  {
		if($per[$i]!=0&$per[$i]!='')
		{
			$id =$per[$i];
			break;
		}
	  }
  }else if($id==0){ 	
	  $per = explode(',',$_SESSION["permission"]);	
	  for($i=0;$i<count($per);$i++)
	  {
		if($per[$i]!='')
		{
			$id =$per[$i];
			break;
		}
	  }
  }
  
  $tpl = new PhplibTpl("./templates");
  $tpl -> set_file("left", "left_menu.htm");
  for( $i = 0 ; $i<=18 ; $i++ )
  {	
	  $tpl->set_block("left","MENU_BLOCK{$i}","menu_block{$i}");
  }
  if($userdata['user_id']!=2)
  //$tpl->set_block("MENU_BLOCK0","RECYCLE","recycle");
  $tpl->parse("menu_block$id","MENU_BLOCK$id");
  $tpl -> parse("Out_left", "left");
  $tpl -> p("Out_left");
?>